package com.amon.optimize.vistor;

import org.gradle.api.Project;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.Opcodes;

public class MonitorImageClassVisitor extends ClassVisitor {
    private final String mSuperName;
    private final Project mProject;

    public MonitorImageClassVisitor(Project project, String superName, ClassVisitor classVisitor) {
        super(Opcodes.ASM6, classVisitor);
        this.mSuperName = superName;
        this.mProject = project;
    }

    @Override
    public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
        if (superName.equals("android/widget/ImageView") && !name.equals(mSuperName)) {
            superName = mSuperName;
            System.out.println("name:" + name + " superName:" + superName);
        }
        super.visit(version, access, name, signature, superName, interfaces);
    }
}
